//
//  TimingCode.cpp
//  learnC++
//
//  Created by apple on 2018/6/4.
//  Copyright © 2018年 yunfan.com. All rights reserved.
//

#include "TimingCode.hpp"

Mytime::Mytime():m_beg(std::chrono::high_resolution_clock::now()){
    
}

void Mytime::reset(){
    m_beg = std::chrono::high_resolution_clock::now();
}

double Mytime::elapsed()const{
    //流逝
    return std::chrono::duration_cast<std::chrono::duration<double,std::ratio<1>>>(clock_t::now()-m_beg).count();
}
